package com.java8.lambda.dome;

import com.java8.lambda.Calculator;

public class test6 {
    public static void master() {
        System.out.println("-----------------test6.master()-----------------");

        Calculator addCalculator = (double x, double y) -> x + y;
        System.out.println(addCalculator.operate(2, 4));

        Calculator subCalculator = (x, y) -> x - y;
        System.out.println(subCalculator.operate(2, 4));

        Calculator mulCalculator = (x, y) -> {
            return x * y;
        };
        System.out.println(mulCalculator.operate(2, 4));

        Calculator divCalculator = (x, y) -> x / y;
        System.out.println(divCalculator.operate(2, 4));
    }
}
